public class Solution2231 {
    public int largestInteger(int num) {
        String s=String.valueOf(num);
        char[] chars=s.toCharArray();
        for (int i=0;i<chars.length;i++){
            for (int j=i+1;j<chars.length;j++){
                if ((chars[i]-'a')%2==(chars[j]-'a')%2 && chars[j]>chars[i]){
                    char t=chars[i];
                    chars[i]=chars[j];
                    chars[j]=t;
                }
            }
        }
        return Integer.parseInt(String.valueOf(chars));
    }

    public static void main(String[] args) {
        System.out.println(new Solution2231().largestInteger(1234));
    }
}
